Privacy-preserving for assembly deviation prediction in a machine learning model of hydraulic equipment under value chain collaboration

Hydraulic equipment, as a typical mechanical product, has been wildly used in various fields. Accurate acquisition and secure transmission of assembly deviation data are the most critical issues for hydraulic equipment manufacturer in the PLM-oriented value chain collaboration. Existing deviation prediction methods are mainly used for assembly quality control, which concentrate in the product design and assembly stage. However, the actual assembly deviations generated in the service stage can be used to guide the equipment maintenance and tolerance design. In this paper, a high-fidelity prediction and privacy-preserving method is proposed based on the observable assembly deviations. A hierarchical graph attention network (HGAT) is established to predict the assembly feature deviations. The hierarchical generalized representation and differential privacy reconstruction techniques are also introduced to generate the graph attention network model for assembly deviation privacy-preserving. A derivation gradient matrix is established to calculate the defined modified necessary index of assembly parts. Two privacy-preserving strategies are designed to protect the assembly privacy of node representation and adjacent relationship. The effectiveness and superiority of the proposed method are demonstrated by a case study with a four-column hydraulic press.

www.nature.com/scientificreports/ consider the geometrical feature deviations during usage. Disregarding deformations, these studies fall within the category of rigid body assembly. Besides, the deviations generated in the service stage are not used to guide the product maintenance or improve the tolerance allocation 18 . Furthermore, a mechanical assembly can be regard as a feature graph [19][20][21] . As the development of artificial intelligence, there is a promising branch to generalize the machine learning algorithms 22,23 to graph domain [24][25][26] . And the missing deviations in the assembly are expected to be predicted based on its feature graph. In this paper, a hierarchical graph attention network (HGAT) [27][28][29] was proposed to predict the unknown assembly deviations of the hydraulic equipment, and a derivation gradient matrix is defined for equipment maintenance. On the one hand, the hierarchical mechanism of proposed HGAT method is beneficial for utilizating graph structure information. On the other hand, the weights of adjacent nodes further improve the accuracy of the deviation prediction.
The deviation prediction process contains two stages. The first is the training stage, where the training data are imported into the algorithm. To reduce the loss on the validation set, the training parameters and hyperparameters are optimized based on backpropagation. The second stage is prediction stage, using the target model to predict the deviations on the test set. Therefore, the potential privacy threats could happen in these two stages 30 as shown in Fig. 1a. Specifically, during the training stage, it mainly faces the threat of data theft. During the prediction stage, there may be more threats such as model inversion, membership inference, and data theft. A high-performance model depends on both rich features and complete edge information in the graph. Surprisingly, there is very little research on privacy protection of high-performance graph neural network models [31][32][33] .
The data theft means the raw data have the risk of being stolen. Especially, in the application of a large-scale machine learning algorithm, it is necessary to train the algorithm on the server by the cooperation of many users. The cloud transmission of data increases the possibility of being attacked. Given that the attacker has some access to the target model, model inversion techniques aim to infer the class representation, as shown in Fig. 1b. 34 . The attacker needs to provide some auxiliary, which could be some experience or human knowledge. The concept of model inversion is introduced by Fredrikson et al. 35 . They showed how the adversary using the outputs from a classifier to infer the sensitive features used as inputs. These techniques are sometimes described as violating the privacy of the training data, even though the inferred features are characterized by the entire class. The membership inference attack means infer whether a given data point belongs to the training dataset as shown in Fig. 1c. For example, if the heath records are used to train a classifier, discovering a specific record that was used to train will cause sensitive information leak of the individual.
In the present work, firstly, the graph model used to predict the deviations is proposed. The nodes the edges in the graph are defined according to the assembly relationship. Secondly, two privacy-preserving strategies are designed to protect the privacy of node representation and relationship in the graph. Compared with the related works in recent years, it has three contributions.
(1) The hierarchical graph attention network (HGAT) is established to predict the unknown deviations of the assembly.  www.nature.com/scientificreports/ (2) The derivation gradient matrix is processed based on the completed deviation data to calculate the defined modified necessary index (MNI). (3) A hierarchical generalized representation and a differential privacy reconstruction are designed to protect the node representation and adjacent matrix, respectively.
The following sections are organized as follows. The graph model used in the graph neural network is given in "Graph model establishment". The methodologies employed for deviations prediction and privacies protection are described in "Methodology". To verify the extensiveness and effectiveness of the proposed method a case study is discussed in "Case study". The conclusion is summarized in "Conclusion".

Graph model establishment
A complex hydraulic equipment 36 is composed of many parts as shown in Fig. 2. In fact, the assembly relationships can be represented by a feature graph. The definition of nodes and edges in the graph are introduced in this section. The establishment of the graph model is the basis of the graph neural network algorithm for the deviation prediction.
The node definition. The unspoken details of the part features need to be clarified before defining the nodes. Taking the conical surface 37 as an example, as shown in Fig. 3. The nominal feature is the conical surface on the nominal geometric model. Its axis is the nominal derivative feature. The so-called deviation means that the axis is derived from the conical surface. The real surface corresponding to the nominal feature obtained from  www.nature.com/scientificreports/ the actual processing is the real feature. However, in the actual inspection process, only a limited number of these features were sampled. These are called extracted features. Then the ideal surface matched to the extracted point is called the associative feature. The derived elements of the association are derived from the associated elements. We define each node has up to two circles. The solid circle represents the real feature, and the associated derived feature is expressed as a dashed circle around the solid circle. The node representation is used to train the network, which should contain as much information of the node as possible. Here we define the node representation n as: where (u, v, w, α, β, γ) are the measured deviations that along and around the global coordinate system. (x, y, z) is the coordinate point of the local feature. m is the number of nodes in the shortest path between the part feature and the reference feature.
The node label is defined by a comprehensive indicator l c . It is defined as: where w 1 , w 2 , w 3 , w 4 , w 5 , and w 6 (p 1 , p 2 , p 3 , p 4 , p 5 , p 6 ) are the weights corresponding to each element. Then the node label is determined by discretizing the value of l c .
The edge definition. The edge is determined by the tolerance mode. Specifically, the self-reference tolerance is the edge that links the solid circle and the dashed circle of the same node. The cross-reference tolerance is the edge that links two dashed circles that corresponding to the same part. The fit tolerance is the edge that links two solid circles that corresponding to different parts. For example, the feature graph of one component is showed in Fig. 4. The assembly consists of two parts, parts 1 and 2. The surface of 1a has a perpendicularity tolerance with 1b, 1b has a fit tolerance with 2a, 2a and 2b have a perpendicularity relationship. Finally, there is a positioning relationship between 2b and 1a. The final feature graph is shown in Fig. 4b.

Methodology
Deviation prediction. This section describes assembly deviation prediction and identifies the feature surfaces that have the greatest impact on the functional requirements of in-service complex mechanical assemblies. The assembly deviation prediction focuses on the difference between the surface of the part in service and its ideal position. Large discrepancies lead to assembly failures. The PLM-oriented value chain collaboration aims to improve the enterprise's core competitiveness, which combined the manufacturing system data with artificial intelligence, big data and other technologies to make the best decisions. This paper focuses on the collection and processing of product data, manufacturing data and process data in the manufacturing systems. Based on the background of PLM-oriented value chain collaboration, a framework of deviation prediction for complex mechanical assemblies is presented. As shown in Fig. 5, a closed-loop feedback of measured deviations is introduced to the design framework, which helps to extend the service life of the products. The process of the assembly deviation prediction includes four stages. The first stage is the product design stage. The design engineers build a three-dimensional model of the assembly and make detailed two-dimensional drawings based on design experience, including the overall dimensions of each part and detailed tolerances. The second stage is the product service stage. Workers in the manufacturing department process mechanical products according to the requirements of the drawings. After the quality inspection, the assembled products can be put into service. The third stage is the deviation perception stage. When the assembly functions no longer meet the design requirements, the deviation information collected by each sensor is used to prepare for product maintenance and product upgrade. The fourth stage is deviation tracing. Based on a small sample of measured deviations, all the unmeasured deviations are calculated by the machine learning method. The deviations are traced through the deviation gradient matrix. And further judge whether the deviations are caused by the structure deformation or the unreasonable tolerance design. If it is caused by the structure deformation, repair or replace the product. If it is caused by an unreasonable tolerance design, a tolerance reallocation design is necessary. Deviation tracing in this study aims to find unreasonable tolerance allocations in the design process or feature surfaces that no longer satisfy the precision requirements due to product service. This research only focuses on the situation in which the actual position of the surface deviates from the ideal position. Define the necessary modify index MNI ij based on the node label l as In the process of the deviation prediction, a certain amount of data is input to support the training of neural network. Generally, the more the number of markers, the higher the accuracy of the prediction. However, if there is insufficient deviation data for testing, all the input deviation data generated by the simulation can be used to debug the hyperparameters of the HGAT model. This study assumes that the deviations obey a normal distribution. Once the interval of FRs is known, the mean and the variance values of deviations can be calculated using the 3σ criterion 38 . Then the unknown labels can be obtained by importing the measured data into the HGAT model. We can take the value if there is more than one set of test data. After all the node labels are obtained, it is important to identify the tolerance values that need to be redesigned. The recognition process is based on the value of MNI ij . The larger the MNI ij value, the more likely the error source is. And a higher accuracy of this tolerance should be prioritized to avoid the deviation transmission. The accuracy grade of adjustment is related to the processing cost, which is not considered in this research. Replace the corresponding elements in the adjacency matrix with MNI ij to obtain the deviation gradient matrix S. The calculation of S can be carried out by the following formula: where abs() is the absolute value function, * is the dot product operation, A is the adjacency matrix of the feature graph, and D is the deviation vector composed of all nodes in the feature graph. It is a node label composed of one-dimensional vector. It should be pointed out that S can only help engineers propose strategies for tolerance improvement, it cannot directly indicate what specific value should be increased.
The proposed HGAT framework can be divided into three parts: input layer, hierarchical layer and prediction layer. A GAT algorithm was used in the input layer and a multi-head mechanism was used to stabilize the learning process. The input of the input layer is the initial graph N0 and the output node representation N 1 can be calculated as follows 39 : where I is the number of head, T i is the transformation matrix, σ () is the nonlinear ELU activation function, and α i is the regularized graph attention coefficient matrix.
There are l layers in the hierarchical layer. Each layer consists of two types of symmetrical operations, called coarse calculation and refined calculation. Inspired by k-way partitioning scheme 40 , the connection strength between node v j and node v k is defined as: www.nature.com/scientificreports/ where A i and D i are the adjacency matrix and the degree matrix of graph G i . The coarse calculation of the graph is a kind of contraction operation which captures global structure and ignores details. Based on the contraction set, the contraction matrix M i (r, h) is defined as where V r i denotes the contraction set of graph G i . Thus, the node representation and the adjacency matrix of graph G i+1 can be calculated as follows; The refined calculation is introduced to restore the graph structure reduced by the coarse calculation. Based on the refined calculation, the node representation is defined as The detailed process of hierarchical layer calculation is described as follows.
At last, a softmax classifier is added in prediction layer to predict the one-hot encoded node labels, which reflecting the magnitude of the deviation.
The error traceability process is shown in Fig. 6. According to the node labels, the tolerance represented by the outliers in S is selected for the actual test. When the design requirements are not met, it means that the tolerance www.nature.com/scientificreports/ constraints are no longer satisfied due to wear or force. The corresponding parts should be processed again or replaced directly. If it is within the design range, the accuracy grade of the design scheme needs to be improved. Finally, output the improvement scheme.
Privacy-preserving. The purpose of this section is to increase the privacy-preserving ability of the graph neural network algorithm. More specifically, we focus on the preservation of node representation and relationships in the graph.
A The node representation protection . To protect the node representation, a hierarchical generalized representation is proposed as shown in Fig. 7a We train the graph neural network model in the local server. Thus, it is not accessible by the adversary. In the application of the HGAT model, the node representation faces a hazard of being attacked. We employ the coarsening procedure to calculate the node representation in different coars-   www.nature.com/scientificreports/ ening levels. Then we refine the graph to have the representation of each original node. Afterward, we use the aggregation method to synthesis new node representation. Thus, the new node representation contains classified information of the original one, even if it is attacked, it will not leak the node privacy directly.
The adjacent matrix protection . To protect the adjacent matrix, a differential privacy reconstruction is proposed as shown in Fig. 7b Similarly, we classify the process accessible by the adversary (red dotted box in Fig. 7b) and not accessible by the adversary (green dotted box in Fig. 7b). We start with the raw graph with rich adjacent information. Noises are added by depressing and adding the edges randomly. To reduce its negative effects on the subsequent training process, a graph learning layer is added to remodify its adjacent matrix. Then the node representation is calculated according to the adjacent matrix. Therefore, the raw graph is protected by the proposed methodology.

Case study
The four-column hydraulic equipment shown in Fig. 8a consists of many parts. But not every part is essential for feature graph molding. To simplify, the key parts of hydraulic equipment have been selected, such as the worktable (1), the slider (2), the piston rod (3), the columns (4, 5, 6 and 7), the beam (8), and the cylinder (9). Due to the frequent reciprocating movement of the slider, the accumulated deviation is the largest when the piston rod reaches the maximum position and the slider moves to the lowest point at the same time. Therefore, this study chooses this position to establish the feature graph. The simplified three-dimensional hydraulic equipment assembly and detailed definition of the nodes are shown in Fig. 8c. The feature graph of four-column hydraulic equipment is shown in Fig. 8b. There are 31 nodes and 47 edges in the feature graph, and the adjacency relationship of nodes are shown in Table 1. The 31 nodes in the feature graph are divided into three types of data sets, as shown in Table 2. The ratio of the test set to the verification set is the same as that of the standard data set. The training set is used to train the neural network, which including all the nodes with labels. The validation set is used to select hyperparameters. The test set is used to test the accuracy of the algorithm. The labels of all the nodes are used to debug the proposed model. www.nature.com/scientificreports/ Next, calculate the deviation gradient matrix based on the test data. Based on the simulation data, the main hyperparameters obtained by debugging are as follows: the classification level is 1, the weight decay is set to be 0.01, and there is no dropout. The input layer contains 8 attention headers. The deviations are shown in Table 3. The labels are defined according to their l c values. The on-site measurement process of physical objects and deviations of the hydraulic press to be repaired are shown in Fig. 8a. Limited by the conditions, a micrometer tool with a special measuring tool are used for measurement. The inverse trigonometric function formula is used to convert the measured distance data into angle data. For the feature surfaces that are difficult to test, the deviations are assumed to obey a normal distribution in the FR interval, and the deviation data are generated by the Monte Carlo simulation method.
The nodes 1a-8b in Table 3 represent the upper surface of the worktable (1), the upper surface of the slider (2), the lower surface of the slider (2), the outer surface of the piston rod (3), the outer cylindrical surface of the column (4), the outer cylindrical surface of the column (5), the outer cylindrical surface of the column (6), the outer cylindrical surface of the column (7), the lower surface of the upper beam (8), and the upper surface of the upper beam (8), respectively. Before calculating the deviation gradient matrix S, the HGAT model is used to predict the missing labels by minimizing the cross-entropy loss of the data in Table 3. As shown in Fig. 8d, a color map (Table 4) is used on the graph to represent all node labels. These predicted values can provide a reference for maintenance. The slider (2) and one side of the piston rod (3) connected to the slider are deformed greatly due to the deformation of the column (6). The deviation of the connection side between the upper beam (8) and the column (4) is large. Therefore, according to actual production experience, replacing the column (6) and adjusting the upper and lower bolts m s1 and m s2 to make the upper beam level is the best maintenance strategy.
The tolerance values that need to be improved are determined according to the deviation gradient matrix S. The values of S are shown in Table 5, and the values not listed in the table are all 0. The first four maximums in S represent edges 6a-6b, 2c-5d, 2d-5e, and 2d-5f, respectively. The values are 4, 3, 3, and 3 respectively. It is assumed that the actual tolerances are still within the design range at this time. To improve the tolerances, the verticality of the outer surface and the step of the column, the position tolerance of the four holes on the slider, and the verticality of the four holes on the slider to its lower surface should give a higher accuracy value. Table 1. Adjacency relationship of nodes in the feature graph.

Conclusion
Machine learning models provide new possibilities to gain high-fidelity prediction based on existing observable assembly deviations during usage. These deviations are useful for product redesigns and repairs throughout the product life cycle. In this paper, a novel privacy-preserving method for assembly deviation prediction was proposed based on the HGAT algorithm. The HGAT is established based on the defined feature graph to predict the unknown deviations of the assembly. Afterwards, to-be-improved deviations are identified based on the deviation gradient matrix. Then, two strategies are introduced to protect the privacy of deviations. The hierarchical generalized representation and the differential privacy reconstruction are constructed based on the HGAT algorithm to protect the privacy of node representation and the adjacent matrix, respectively. Finally, a fourcolumn hydraulic press is selected to verify the feasibility and superiority of the proposed method. The proposed method is effective and has the advantage of predicting assembly deviations caused by unknown deformation derivations during usage. The prediction accuracy of assembly deviations is guaranteed by assigning different weights to adjacent nods, while the HGAT guarantees the efficiency of the whole method. Also, it can be widely used to handle the other data issues under PLM-oriented value chain collaboration. Such as visual relationship detection and stock movement prediction. However, there are also some limitations and disadvantages. The node representation is relatively simple that only consists of tolerance chain information and node location information. The proposed method is based on some assumptions that may not be satisfied in the actual situation. For example, the derivations obey a normal distribution. The priority of accuracy improvement is proposed, but the quantitative analysis is missing.
Thus, the future directions can be concluded as follows. The machine learning model is in development and may lead to an improved node representation with sufficient graph information. The qualitative analysis is limited in deviation degree as well as maintenance location, suggesting quantitative analysis to determine the critical values of to-be-improved deviations. With respect to tolerance allocation, the multi-objective optimization model should be established with the consideration of actual manufacturing cost for different accuracy levers.

Data availability
The datasets used and/or analyzed during the current study are available from the corresponding author on reasonable request.